# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ufonet
pkgver=84.aea21b3
pkgrel=4
groups=('blackarch' 'blackarch-dos' 'blackarch-webapp')
pkgdesc="A tool designed to launch DDoS attacks against a target, using 'Open Redirect' vectors on third party web applications, like botnet."
arch=('any')
url='https://github.com/epsylon/ufonet'
license=('custom:unknown')
depends=('python' 'python-pycurl' 'python-geoip' 'geoip' 'python-scapy' 'scapy'
         'python-requests' 'python-pycryptodomex' 'python-pycryptodome'
         'python-crypto' 'python-pygeoip' 'python-python-geoip')
makedepends=('git')
source=("git+https://github.com/epsylon/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md docs/*

  rm -rf README.md docs

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python $pkgname "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

